<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

<style>
    * {
        margin: 0;
        padding: 0;
    }
    
    .hide {
        display: none;
    }
    
    .edit span {
        cursor: pointer;
    }
    
    .mask {
        position: absolute;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.3);
        top: 0;
        left: 0;
    }
    
    #tem {
        display: none;
    }
    
    .popup {
        background-color: #fff;
        padding: 10px;
        display: none;
        position: absolute;
        width: 500px;
        height: 200px;
        z-index: 2;
        left: 35%;
        top: 50%;
    }
    
    .killMargin {
        overflow: hidden;
    }
</style>
</head>

<body>
    <div class="killMargin">
        <div class="right">
            <h3>XI'AN XIANYANG INT'L AIRPORT (陕西 西安 CN) ZLXY / XIY 离港 </h3>
            <hr>
            <table class="table">
                <thead>
                    <tr>
                        <th>标识符</th>
                        <th>机型</th>
                        <th>目的地</th>
                        <th>出发</th>
                        <th>到达</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>AAR348</td>
                        <td>A321</td>
                        <td>Incheon Int'l (ICN)</td>
                        <td>15:10 CST</td>
                        <td>18:14 KST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>FZA6695</td>
                        <td>B738</td>
                        <td>Quanzhou Jinjiang (JJN)</td>
                        <td>15:05 CST</td>
                        <td>17:45 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CHH7509</td>
                        <td>B738</td>
                        <td>Fuzhou Changle Int'l (FOC)</td>
                        <td> 15:00 CST</td>
                        <td>17:28 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>OKA2885</td>
                        <td>B738</td>
                        <td>Urumqi Diwopu Int'l (URC)</td>
                        <td> 14:54 CST</td>
                        <td>18:29 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2259</td>
                        <td>A320</td>
                        <td>Lüliang (LLV)</td>
                        <td> 14:44 CST</td>
                        <td>15:31 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2259</td>
                        <td>A320</td>
                        <td>Lüliang (LLV)</td>
                        <td> 14:44 CST</td>
                        <td>15:31 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2259</td>
                        <td>A320</td>
                        <td>Lüliang (LLV)</td>
                        <td> 14:44 CST</td>
                        <td>15:31 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2259</td>
                        <td>A320</td>
                        <td>Lüliang (LLV)</td>
                        <td> 14:44 CST</td>
                        <td>15:31 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2259</td>
                        <td>A320</td>
                        <td>Lüliang (LLV)</td>
                        <td> 14:44 CST</td>
                        <td>15:31 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2259</td>
                        <td>A320</td>
                        <td>Lüliang (LLV)</td>
                        <td> 14:44 CST</td>
                        <td>15:31 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2259</td>
                        <td>A320</td>
                        <td>Lüliang (LLV)</td>
                        <td> 14:44 CST</td>
                        <td>15:31 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2259</td>
                        <td>A320</td>
                        <td>Lüliang (LLV)</td>
                        <td> 14:44 CST</td>
                        <td>15:31 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2259</td>
                        <td>A320</td>
                        <td>Lüliang (LLV)</td>
                        <td> 14:44 CST</td>
                        <td>15:31 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2259</td>
                        <td>A320</td>
                        <td>Lüliang (LLV)</td>
                        <td> 14:44 CST</td>
                        <td>15:31 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2259</td>
                        <td>A320</td>
                        <td>Lüliang (LLV)</td>
                        <td> 14:44 CST</td>
                        <td>15:31 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2259</td>
                        <td>A320</td>
                        <td>Lüliang (LLV)</td>
                        <td> 14:44 CST</td>
                        <td>15:31 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2321</td>
                        <td>A319</td>
                        <td>Karamay (KRY)</td>
                        <td> 14:51 CST</td>
                        <td>18:26 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr>
                        <td>CES2259</td>
                        <td>A320</td>
                        <td>Lüliang (LLV)</td>
                        <td> 14:44 CST</td>
                        <td>15:31 CST</td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                    <tr id="tem">
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td class="edit">
                            <button class="insertData btn btn-primary">插入</button>
                            <span class="deleat btn btn-danger">删除</span>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="popup">
            <button class="btn btn-primary" id="confirm">确定</button>
            <button id="cancel" class="btn">取消</button>
        </div>
    </div>
    <script src="jquery.min.js"></script>

    <script>
        let tbody = $("tbody");
        $(".deleat").click(function() {
            if (confirm("真删啊？")) {
                $(this).closest("tr").fadeOut();
            }
        })
        $(".insertData").click(function() {
            let newItem = $("#tem").clone(true);
            newItem.attr("id", "");
            $(this).closest("tr").after(newItem)
        })
        $(".table td").click(function() {
            if ($(this).hasClass("edit") || $(this).find("input").length) {
                return;
            }
            let _this = $(this)
            let input = $(`<input type="text" />`)
            input.val($(this).html())
            $(this).html("")

            input.appendTo($(this)).focus().blur(function() {
                _this.html($(this).val())
            })

        })
    </script>


</body>

</html>